package com.neusoft.neu24.nep.filter.globalfilter;

import com.neusoft.neu24.nep.utils.Auth4All;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

@Component
public class CustomGlobalFilter   implements GlobalFilter, Ordered {


    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        System.out.println("CustomGlobalFilter filter");
        return   chain.filter(exchange);
    }

    @Override
    public int getOrder() {
//        数字越小，优先级越高
        return  Ordered.HIGHEST_PRECEDENCE ;
    }
}
